using System;
using System.Data.Linq.Mapping;
using CoreLibrary;
using CoreLibrary.Date;

namespace Entities.DataBase.Persistent {

    [Table(Name = "D_PRODUCT_STOCK")]
    public class Stock {

        public Stock() {
            PriceCurrency   = Enumeration.Currency.AUD.Name;
            PostageCurrency = Enumeration.Currency.RMB.Name;
            Guid            = GuidUtil.GuidN();
            DateCreated     = DateTime.UtcNow;
            DateUpdated     = DateUtil.Epoch;
        }

        [Column(Name = "ID", IsDbGenerated = true, IsPrimaryKey = true)]
        public int Id { get; set; }

        [Column(Name = "GUID")]
        public string Guid { get; set; }

        [Column(Name = "PRODUCT_ID")]
        public string ProductId { get; set; }

        [Column(Name = "LOCATION")]
        public int Location { get; set; }

        [Column(Name="PRICE")]
        public decimal Price { get; set; }

        [Column(Name="PRICE_CURRENCY")]
        public string PriceCurrency { get; set; }

        [Column(Name = "POSTAGE")]
        public decimal Postage { get; set; }

        [Column(Name="POSTAGE_CURRENCY")]
        public string PostageCurrency { get; set; }

        [Column(Name = "STOCK")]
        public int Count { get; set; }

        [Column(Name = "DATE_CREATED")]
        public DateTime DateCreated { get; set; }

        [Column(Name = "DATE_UPDATED")]
        public DateTime DateUpdated { get; set; }

    }
}